With this function you can change the value for the given key within the (previously created) ds_map. Please note that if the key to be replaced does not exists, it is created and the given value assigned to it.
ds_map_replace( id, key, val );
参数 | 描述 |
---|---|
id | The id of the map to change. |
key | The key with the value that should be replaced by the new one |
val | The new value to replace the given value with |
N/A(无返回值)
ds_map_replace(inventory, "torso", 55);
The above code looks up the ds_map for the key "torso" and when it finds it (or it is created if it doesn't exist) the current value is replaced with the one specified.